<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import updateDialog from "@/components/updateDialog/index.js";

export default {
  props: ["userId"],
  mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.List],
  data() {
    return {
      appWindow: window,
      apiUrl: {
        list: "mall-site-portal/member/listMoneyRecord",
        updateApi: "mall-site-portal/member/batchMemberMoney",
      },

      // 列表常量查询参数
      mixinList_tableSearchConst: {
        memberId: "",
      },
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    init(){
        this.mixinList_loading = false;
        this.mixinList_tableSearchConst.memberId = this.userId;
        // 请求第一页
        this.mixinList_getTable();
    },

    updateData() {
      updateDialog.init({
        titleText: "余额",
        requestApi: this.apiUrl.updateApi,
        updateType: "Amount",
        userArr: [this.userId],
        onSuccess: (res) => {
          this.mixinList_getTable();
        },
      });
    },
  },
};
</script>
